<%-- 
    Document   : ListStory
    Created on : Dec 11, 2012, 6:05:33 PM
    Author     : Admin
--%>



<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="javabean.StoryBean"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%
    ArrayList<StoryBean> StoryList = (ArrayList) request.getAttribute("listAllStories");
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="/DeAn_WebTruyen/CSS/Site1.css" type="text/css" rel="stylesheet"/>
    </head>
    <body background="/DeAn_WebTruyen/Images/happy_christmas_holidays-1280x1024.jpg">
        <div class="container">
            <div class="header">
                <div class="header_top_left">
                    <%
                        Date d = new Date();
                        DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");

                        out.print(dateFormat.format(d));
                    %>
                </div>               
                <%--<div class="clear"></div>--%>
                <div class="header_main" > 

                    <script type="text/javascript">
        
                        var img1="12855184861024648803.jpg"
                        var img2="12855185051828767054.jpg"
                        var img3="1285518514197142706.jpg"
                        var img4="1285518527375730281.jpg"
                        var img5="1285518537601341394.jpg"

                        var cur=Math.round(5*Math.random())
                        if (cur<=1)
                        {
                            img=img1
                        }
                        else if (cur<=2)
                        {
                            img=img2
                        }
                        else if (cur<=3)
                        {
                            img=img3
                        }
                        else if (cur<=4)
                        {
                            img=img4
                        }        
                        else
                            img=img5
                        document.write('<div class="header_main" > <img src="/DeAn_WebTruyen/Images/'+img+'"/></div>')
                    </script>

                </div>


            </div>
            <div class="container" style="margin-top: 19px">
                <form name="ListOfStoryForm" action="" method="POST" >
                    
                        <% for (int i = 0; i < StoryList.size(); i++) {
                                StoryBean currentStory = StoryList.get(i);
                        %> 
                        <table style="font-size: 15pt;border-color: white;border-style: double" >
                        
                            <tr><td style="text-align: right;"><b>Thể loại : <%=currentStory.getTl()%></b></td>
                                <td dir="ltr"></td>
                            </tr>
                            <tr></tr>
                            <tr   style="font-size: 12pt">
                                <td>
                                    <%
                                        String link1 = currentStory.getImage();
                                        out.print("<img src = \"/DeAn_WebTruyen/Images/" + link1 + "\"class=\"left\"/>");
                                    %>
                                </td>
                                <td > <%=currentStory.getTitle()%><br/>
                                    <br/><%=currentStory.getGtt()%>
                                    <br/><a href="#">Click để xem onl</a>
                                    <br/><a href="#">Click để đặt mua onl</a>
                                </td>
                            </tr>
                            <tr> <td style="text-align: right"><b>Giá bìa : <%=currentStory.getPrice()%></b> </td><td></td>
                            </tr>
                            </table>
                        <% }%>
                    
                </form>
            </div>
        </div>
    </body>
</html>
